<!--
@author	Yi Bo <etng2004@gmail.com>
@version	$Id: client_edit.php 64 2007-09-10 06:54:16Z etng2004 $
@copyrithg	2006-2007 ETE.CN
@license 	PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
-->
<?php
$this->declareVars();
require_once(dirname(__FILE__) . '/_meta_client.php');
echo $this->render('header.php');
//$this->dump($$this->client);
$client = $this->client;
?>

<form action="<?php echo $this->base_url; ?>/edit/" method="post" enctype="multipart/form-data" name="frmAddclient" id="frmAddclient">
  <input type="hidden" name="fields[id]" value="<?php echo $client['id'];?>"/>
  <table cellpadding="0" cellspacing="0" border="0">
    <tr class="tblhead">
      <td colspan="2">修改</td>
    </tr>
    <?php
	if($this->S_staff['client_type'] == 'ALL'):
	?>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['client_type_code'];?>：</td>
      <td width="85%">
      <?php
  echo $this->formSelect('fields[client_type_code]', $client['client_type_code'], array('id'=>'field_client_type_code'), $this->client_types);
      ?>
      </td>
    </tr>
    <?php
   	else:
    ?>
      <input type="hidden" name="fields[client_type_code]" value="<?php echo $this->staff['client_type'];?>"/>
    <?php
    endif;
    ?>

    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['trade_type_id'];?>：</td>
      <td width="85%">
       <?php
      echo $this->formSelect('fields[trade_type_id]', $client['trade_type_id'], array('id'=>'field_trade_type_id'), $this->trade_types);
      ?></td>
    </tr>
        <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['stage'];?>：</td>
      <td width="85%">
       <?php
      echo $this->formSelect('fields[stage]', @$client['stage'], array('id'=>'field_stage_id'), $LANG['CLIENT_STAGE']);
      ?></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['company'];?>：</td>
      <td width="85%"><input type="text" name="fields[company]" value="<?php echo $client['company'];?>" id="field_company" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['website'];?>：</td>
      <td width="85%"><input type="text" name="fields[website]" value="<?php echo $client['website'];?>" id="field_website" /></td>
    </tr>    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['alexa'];?>：</td>
      <td width="85%"><input type="text" name="fields[alexa]" value="<?php echo $client['alexa'];?>" id="field_alexa" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['phone'];?>：</td>
      <td width="85%"><input type="text" name="fields[phone]" value="<?php echo $client['phone'];?>" id="field_phone" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['fax'];?>：</td>
      <td width="85%"><input type="text" name="fields[fax]" value="<?php echo $client['fax'];?>" id="field_fax" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['email'];?>：</td>
      <td width="85%"><input type="text" name="fields[email]" value="<?php echo $client['email'];?>" id="field_email" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['address'];?>：</td>
      <td width="85%"><input type="text" name="fields[address]" value="<?php echo $client['address'];?>" id="field_address" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['postcode'];?>：</td>
      <td width="85%"><input type="text" name="fields[postcode]" value="<?php echo $client['postcode'];?>" id="field_postcode" /></td>
    </tr>
    <tr class="tblbody">
      <td width="15%"><?php echo $meta['client']['fields']['memo'];?>：</td>
      <td width="85%"><?php
	echo $this->fckeditor('fields[memo]', $client['memo'], 'Basic');
	?></td>
    </tr>
    <tr class="tblfoot">
      <td colspan="2" align="center"><input type="submit" value="发布" /></td>
    </tr>
  </table>
</form>
<div class="develop_notice">
<textarea name="CRMLiteDevelopCode" rows="10" cols="50" wrap="off" onfocus="this.select();">
<table>
  <?php
        foreach ($client as $field => $value):
	?>
	<tr class="tblbody">
	<td width="15%">&lt;?php echo $meta['client']['fields']['<?php echo $field; ?>'];?&gt;：</td>
	<td width="85%"><input type="text" name="fields[<?php echo $field; ?>]" value="&lt;?php echo $client['<?php echo $field; ?>'];?&gt;" id="field_<?php echo $field; ?>" /></td>
</tr>
        <?php
        endforeach;
	?>
</table>
</textarea>
</div>
<script type="text/javascript">
	$(document).ready(function () {

	});
</script>
<?php echo $this->render('footer.php');?>